<?php
include_once 'DbTools.php';
$userkey = $_COOKIE['userKey'];
session_start();
$aa = $_SESSION[$userkey]['username'];
$cc = $_SESSION[$userkey]['AccountId'];
$conn = new mysqli();
$conn ->connect('127.0.0.1','root','root','bankes');
if(!empty($conn->connect_error)){
    echo '数据库连接错误';
    dir;
}else{
    echo '连接成功';
    DbTools::setCoon($conn);
    $data = DbTools::select('select * from accountinfo where AccountId='.$cc);
    $rr = $data['RealName'];
}

if(!isset($_SESSION[$userkey]['username'])){

}else{

}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <style type="text/css">
        #div1 img{
            width: 100px;
            height: 100px;
        }
    </style>
</head>
<body>
<h1>用户中心</h1>
<div id='div1'></div>
<div id="div2">
    <p>更改头像↓</p>
    <p><input type="file"></p>
</div>
<p>你好：<?php echo $rr?></p>

</body>
<script type="text/javascript">
    onload = function(){
        document.getElementById('div1').innerHTML = `<img src="img/111.webp" >`;
    }
</script>
</html>
